﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<MedicinaMuncii.Entities.Employee>"
    Theme="Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    <%: Resources.Global.EmployeeCreatePageTitle %>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>
        <%: Resources.Global.EmployeeCreatePageTitle %>
    </h2>
    <% using (Html.BeginForm())
       {%>
    <%: Html.ValidationSummary(true)%>
    <table>
        <tr>
            <td class="top-aligned">
                <fieldset>
                    <legend>
                        <%: Resources.Global.CompanyLabel%>
                    </legend>
                    <%= Html.HiddenFor(model => model.PersonID)%>
                    <table cellspacing="0" cellpadding="0" class="inputarea">
                        <tr>
                            <td>
                                <%: Resources.Global.CompanyLabel%>
                            </td>
                            <td>
                                <%= Html.Telerik().ComboBox()
                                    .Name("CompanyID")
                                    .AutoFill(true)
                                    .BindTo(new SelectList((IEnumerable<Company>)(ViewData["Companies"]), "ID", "Name"))
                                    .HtmlAttributes(new
                                    {
                                        @class = "width-150"
                                    })
                                    .Filterable(filtering =>
                                    {
                                        filtering.FilterMode(AutoCompleteFilterMode.Contains);
                                    })
                                %>
                                <%: Html.ValidationMessageFor(model => model.CompanyID)%>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <%: Resources.Global.NumberLabel%>*
                            </td>
                            <td>
                                <%: Html.TextBoxFor(model => model.Number)%>
                                <%: Html.ValidationMessageFor(model => model.Number)%>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <%: Resources.Global.OccupationLabel%>
                            </td>
                            <td>
                                <%: Html.TextBoxFor(model => model.Occupation)%>
                                <%: Html.ValidationMessageFor(model => model.Occupation)%>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <%: Resources.Global.PositionLabel%>
                            </td>
                            <td>
                                <%: Html.TextBoxFor(model => model.Position)%>
                                <%: Html.ValidationMessageFor(model => model.Position)%>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <%: Resources.Global.WorkPlaceLabel%>
                            </td>
                            <td>
                                <%: Html.TextBoxFor(model => model.WorkPlace)%>
                                <%: Html.ValidationMessageFor(model => model.WorkPlace)%>
                            </td>
                        </tr>
                    </table>
                </fieldset>
                *<%: Resources.Global.EmployeeNumberWarning%>
            </td>
            <td class="top-aligned">
                <%= Html.EditorFor(model => model.person)%>
            </td>
        </tr>
    </table>
    <div class="edit-button-bar">
        <button class="t-grid-action t-button t-state-default t-grid-update" type="submit">
            <span class="t-icon t-update"></span>
            <%: Resources.Global.CreateLabel%>
        </button>
        <a class="t-grid-action t-button t-state-default t-grid-cancel" href="<%=Url.Action("Index", "Employee")%>">
            <span class="t-icon t-cancel"></span>
            <%: Resources.Global.CancelLabel%>
        </a>
    </div>
    <%} %>
</asp:Content>
